package com.itheima.edu.info.manager.service;

import com.itheima.edu.info.manager.dao.StudentDao;
import com.itheima.edu.info.manager.domain.Student;

public class StudentService {
    private StudentDao studentDao=new StudentDao();
    public boolean isEmptyById(String id) {
        if(studentDao.findIndexById(id)!=-1){
            return false;
        }else {
            return true;
        }
    }

    public boolean addStudent(Student student) {
       return studentDao.addStudent(student);
    }

    public Student[] findAllStudent() {
        return studentDao.findAllStudent();
    }

    public void deleteStudent(String id) {
        studentDao.deleteStudent(id);
    }

    public void updateStudent(String id,Student s) {
        studentDao.updateStudent(id,s);
    }
}
